//api文件仍保留但不建议使用，推荐使用models中的api。API files remain preserved (deprecated), use models APIs instead.
import type { WechatopenApplet, WechatopenAppletResponse } from './types.js';

import { requestClient } from '#/api/request';

export const getuctooWechatopenAppletList = async (page: number, pageSize: number,
  searchParams?: any) => {
  return requestClient.get<WechatopenAppletResponse>(`/uctoo/wechatopen_applet/${pageSize}/${page}`,{
    params: searchParams,
  });
};

export const getuctooWechatopenApplet = async (id: string) => {
  return requestClient.get<WechatopenApplet>(`/uctoo/wechatopen_applet/${id}`);
};

export const adductooWechatopenApplet = async (data: Partial<WechatopenApplet>) => {
  return requestClient.post<WechatopenApplet>('/uctoo/wechatopen_applet/add', data);
};

export const edituctooWechatopenApplet = async (data: Partial<WechatopenApplet>) => {
  return requestClient.post<WechatopenApplet>('/uctoo/wechatopen_applet/edit', data);
};

export const deleteuctooWechatopenApplet = async (id: string) => {
  return requestClient.post<any>('/uctoo/wechatopen_applet/del', { id });
};
